package com.yikome.delivery.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.yikome.common.CommonRepository;
import com.yikome.delivery.entity.Delivery;

@Repository
public interface DeliveryRepository extends CommonRepository<Delivery, Long> {
	
	@Query("select t from Delivery t where t.yn = 1 and t.deliveryCode = :deliveryCode")
	Delivery findDelivery(@Param("deliveryCode")String deliveryCode);

	@Query("select t from Delivery t where t.yn = 1 and t.status = :deliveryStatus")
	List<Delivery> findByStatus(@Param("deliveryStatus")Integer deliveryStatus);

}
